1. Field of the Invention
The present invention relates to an image processing apparatus having a function for correcting distortion of an image, a control method, and a program.
2. Description of the Related Art
There is known a function of recognizably displaying, when playing back an image captured by an imaging apparatus using the imaging apparatus or an image processing application software program for a personal computer (PC), an autofocus (AF) frame that was selected from among a plurality of AF frames during an AF operation of the imaging apparatus. There is also known, as discussed in Japanese Patent Application Laid-Open No. 2000-125178, a function of automatically enlarging and displaying the position of an AF frame selected during the AF operation to facilitate confirmation of a focusing state of the captured image using an image processing apparatus or an image processing application software program for a PC.
As described above, to facilitate confirmation of the focusing state of an image captured by the imaging apparatus, conventionally, position information of the AF frame selected during the AF operation is recorded in the image, and during playback of the image, the position of the selected AF frame is displayed or displayed and enlarged on a display unit of the imaging apparatus.
On the other hand, in an image captured by the imaging apparatus, distortion can occur due to the effects of an optical system including a focus lens and a zoom lens. Commercially-available countermeasures against such distortion include an imaging apparatus or an image processing application software program for a PC that is provided with a function for correcting distortion using image processing of the captured image.
However, if this countermeasure is combined with the above-described conventional function, there are the following problems.
When distortion correction is performed on a captured image, the position of an object photographed as the image is shifted compared with before correction. As a result, if the position of the AF frame with respect to the image which has undergone distortion correction is displayed or enlarged and displayed using directly the position information of the AF frame recorded before the distortion correction is performed, a shifted position from the actual AF frame position may be displayed or enlarged and displayed. The details of this will be described with reference to FIG. 10.
FIG. 10 illustrates an example of display of an AF frame during playback of a barrel type distortion image.
FIG. 10 illustrates an example in which, when playing back and displaying a barrel type distortion image 1000 captured by an imaging apparatus, the position of an AF frame 1002 is displayed on a display unit of an imaging apparatus to facilitate focusing confirmation. In FIG. 10, the dotted line 1001 represents an example of image distortion. Typical examples of distortion include the barrel type distortion illustrated in FIG. 10 and the pin-cushion type distortion illustrated in the below-described FIG. 11.
The seven square frames illustrated in FIG. 10 are the AF frames which can be selected during image capture. The imaging apparatus selects any one, or a plurality, of these seven AF frames, and performs AF so as to adjust the focus on an object which is located at the position of the selected AF frame (s). Further, among the seven square frames, the square frame indicated by a bold line is the AF frame 1002 selected as where the main object is present. FIG. 10 illustrates a state in which the AF frame 1002 where a main object 1003 is present is selected. The imaging apparatus records the position information of these AF frames in the image during image capture of the image. Further, using the position information during playback of the image, the imaging apparatus displays the position of the seven selectable AF frames and the position of the AF frame 1002 selected to be used in focus adjustment.
FIG. 11 illustrates an example of display of an AF frame during playback of a pin-cushion type distortion image.
In FIG. 11, the dotted line 1100 represents an example of a pin-cushion type distortion image when an image captured by the imaging apparatus is played back.
FIG. 12 illustrates a problem in the conventional art when distortion correction is performed on a barrel type distortion image.
FIG. 12 includes an image 1200 which has undergone barrel type distortion correction. By performing correction, the image size is made slightly larger than the pre-correction image 1001 in FIG. 10. Further, the dotted line 1201 indicates that the image 1001 (barrel type distortion) is corrected. The image 1200 includes a main object 1203 obtained by performing distortion correction on the main object 1003 illustrated in FIG. 10.
The seven square frames illustrated in FIG. 12 are displayed on the playback image 1200, which has undergone distortion correction, using the position information of the AF frames recorded in the image 1000. Further, among the seven square frames, the square frame indicated by a bold line is the AF frame 1202 selected as where the main object is present. If the position information of the AF frame recorded in the image is used directly and displayed on the playback image, the position of the main object 1203 is shifted with respect to the position of the pre-correction main object 1003. As a result, the position that is shifted from the post-correction main object 1203 is indicated as the AF frame 1202.
How the AF frame 1202 is shifted with respect to the main object 1203 depends on how the position information of the AF frame is recorded in the image. FIG. 12 illustrates a case where the position of the AF frame is recorded using coordinates with the center of the image as the origin. Similarly, if the position of the AF frame is recorded using coordinates with the upper left corner of the image as the origin, for example, as illustrated in FIG. 13, the AF frame is displayed as being shifted to the upper left.
FIG. 14 illustrates a problem in the conventional art when distortion correction is performed on a pin-cushion type distortion image.
In FIG. 14, when distortion correction is performed on the pin-cushion type distortion image, the image becomes slightly smaller than before correction. Similar to barrel type distortion, if the position information of the AF frame recorded in the image during image capture is used directly, and the position of the AF frame is displayed on the image which has undergone distortion correction, the position 1402 of the AF frame is displayed at a position that is shifted from a main object 1403.